package cn.gson.boot.model.pojos;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

@Entity
@Table(name = "target_", schema = "boot", catalog = "")
//销售目标表
public class Target {
    private int targetId;//销售目标id
    private User empId;//员工id
//    private Huikuan hkId;//回款id
    private BigDecimal targetMb;//销售目标
    private BigDecimal targetYj;//销售业绩
    private BigDecimal targetAccomplish;//完成值
    private Timestamp targetCjsj;//创建时间
    private Timestamp targetGxsj;//更新时间
    private String targetBzhu;//备注

    @Id
    @Column(name = "target_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getTargetId() {
        return targetId;
    }

    public void setTargetId(int targetId) {
        this.targetId = targetId;
    }

    //一个销售目标对应多个
//    @OneToMany
//    @JoinColumn(name = "hk_id", nullable = true)
//    public Huikuan getHkId() {
//        return hkId;
//    }
//
//    public void setHkId(Huikuan hkId) {
//        this.hkId = hkId;
//    }

    //多个销售目标对应一个经手人
    @ManyToOne
    @JoinColumn(name = "emp_id", nullable = true)
    public User getEmpId() {
        return empId;
    }

    public void setEmpId(User empId) {
        this.empId = empId;
    }

    @Basic
    @Column(name = "target_mb", nullable = true, precision = 0)
    public BigDecimal getTargetMb() {
        return targetMb;
    }

    public void setTargetMb(BigDecimal targetMb) {
        this.targetMb = targetMb;
    }

    @Basic
    @Column(name = "target_yj", nullable = true, precision = 0)
    public BigDecimal getTargetYj() {
        return targetYj;
    }

    public void setTargetYj(BigDecimal targetYj) {
        this.targetYj = targetYj;
    }

    @Basic
    @Column(name = "target_accomplish", nullable = true, precision = 0)
    public BigDecimal getTargetAccomplish() {
        return targetAccomplish;
    }

    public void setTargetAccomplish(BigDecimal targetAccomplish) {
        this.targetAccomplish = targetAccomplish;
    }

    @Basic
    @Column(name = "target_cjsj", nullable = false)
    public Timestamp getTargetCjsj() {
        return targetCjsj;
    }

    public void setTargetCjsj(Timestamp targetCjsj) {
        this.targetCjsj = targetCjsj;
    }

    @Basic
    @Column(name = "target_gxsj", nullable = false)
    public Timestamp getTargetGxsj() {
        return targetGxsj;
    }

    public void setTargetGxsj(Timestamp targetGxsj) {
        this.targetGxsj = targetGxsj;
    }

    @Basic
    @Column(name = "target_bzhu", nullable = true, length = 255)
    public String getTargetBzhu() {
        return targetBzhu;
    }

    public void setTargetBzhu(String targetBzhu) {
        this.targetBzhu = targetBzhu;
    }
}
